home *** CD-ROM | disk | FTP | other *** search
- Path: news-m01.ny.us.ibm.net!usenet
- From: hopkinc@ibm.net
- Newsgroups: comp.lang.pl1,comp.lang.c
- Subject: Re: PL/I and C
- Date: 27 Feb 1996 15:38:08 GMT
- Message-ID: <4gv8h0$3o2k@news-s01.ny.us.ibm.net>
- References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU> <312CCEB2.4AB7@corp.dialog.com> <4grhtv$s31@goanna.cs.rmit.EDU.AU> <4gt0tv$826@solutions.solon.com>
- Reply-To: Chris_harlow@artemis-intl.com
- NNTP-Posting-Host: slip139-92-21-67.lo.uk.ibm.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4gt0tv$826@solutions.solon.com>, seebs@solutions.solon.com (Peter Seebach) writes:
-
- >Yes, C's string handling is primitive. It also has no hidden overhead.
-
- I'm sure you know C better than me but I know enough C to refute your
- statement... for example:
-
- (1) The PL/1 equivalent of strlen() requires only a single load instruction.
- Wheres the 'hidden overhead'... you guessed it, its in the C library!
-
- (2) My processor has a move-n-bytes instruction.
- When I assign a string to a string in PL/1 the compiler knows in advance
- WITHOUT OVERHEAD how many bytes it is going to have to move and simply
- generates the required single instruction. (even on cpus without move-n-bytes
- instructions, I have seen PL/1 generated code that performed 4-byte move
- instructions or load/stores until it was within 3 bytes of the end of the string..
- this is far more intelligent than having to check every byte for null..)
-
- Many have pointed out that C is rather lower level than PL/1 and I dont think
- anyone would disagree. My point is that the C language is sometimes at a
- lower level than my processors machine code... this puts extra load in the
- C string library...
-
- SO I think a better statement would have been:
- Yes, C's string handling is primitive AND it contains hidden overhead.
-
-